﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BackgroundTest.BasicAbstracts;

namespace BackgroundTest.BasicAbstracts
{
    /************************************************************************/
    /* Class name: Camera                                                   */
    /* Function: Provide the view point of the game, the render position is */
    /*           directly influenced by the position of camera.             */
    /************************************************************************/

    public class Camera
    {
        public Camera()
        {
            position = new VectorScreen(0, 0);
        }

        // The position of the camera
        public VectorScreen position { get; set; }

        // Used to refresh camera to a specific position
        public void SetCamera(int _x, int _y)
        {
            position.x = _x;
            position.y = _y;
        }

        public void SetCamera(VectorScreen _position)
        {
            position.x = _position.x;
            position.y = _position.y;
        }

        // Used to move camera with a direction
        public void MoveCamera(int _x, int _y)
        {
            position.x -= _x;
            position.y -= _y;
        }

        public void MoveCamera(VectorScreen _vector)
        {
            position.x -= _vector.x;
            position.y -= _vector.y;
        }
    }
}
